<script setup>
import CarouselBackground from "@/components/home/CarouselBackground.vue";
import {reactive} from "vue";
import NoticeBoard from "@/components/home/NoticeBoard.vue";
import libraryImage from '@/assets/school-photos/图书馆周边.jpg'
import swanLakeImage from '@/assets/school-photos/天鹅湖.jpg'
import BuildingImage from '@/assets/school-photos/思学楼内部.jpg'
import router from "@/router/index.js";

const staticImages = [libraryImage, swanLakeImage, BuildingImage];

const form = reactive({
  searchContent: ''
})

function clickSearch(){
  router.push({path:"/index/jobs",query:{q: form.searchContent}});
}
</script>

<template>
  <CarouselBackground :images="staticImages">
    <div class="content-container">
      <h1 class="title">诚聘海内外优秀人才</h1>

      <div class="search-container">
        <input type="text" placeholder="请输入岗位名称/专业搜索" class="search-input" v-model="form.searchContent"/>
        <svg class="search-icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" @click="clickSearch">
          <path d="M15.5 14H14.71L14.43 13.73C15.41 12.59 16 11.11 16 9.5C16 5.91 13.09 3 9.5 3C5.91 3 3 5.91 3 9.5C3 13.09 5.91 16 9.5 16C11.11 16 12.59 15.41 13.73 14.43L14 14.71V15.5L19 20.49L20.49 19L15.5 14ZM9.5 14C7.01 14 5 11.99 5 9.5C5 7.01 7.01 5 9.5 5C11.99 5 14 7.01 14 9.5C14 11.99 11.99 14 9.5 14Z" fill="currentColor"/>
        </svg>
      </div>

      <p class="description">
        栉风沐雨，薪火相传；筚路蓝缕，玉汝于成。杰出人才的引进，是高校建设不可或缺的环节；
        综合发展的平台，也为卓越人才提供了一展才华的机会和成长的环境。
        本校诚邀海内外优秀人才应聘本校岗位，让各位都人尽其才，悉用其力，与本校共同发展。
      </p>
    </div>
  </CarouselBackground>
  <NoticeBoard/>
</template>

<style scoped>
.content-container {
  position: absolute;
  width: 30%;
  height: 40%;
  left: 10%;
  top: 15%;
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 20px;
  box-sizing: border-box;
}

.title {
  color: white;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin: 0;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-input {
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  backdrop-filter: blur(5px);
  width: 100%;
  padding: 12px 0 12px 25px;
}

.search-input:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.search-input:hover {
  border-color: rgba(255, 255, 255, 1);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.search-icon {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: color 0.3s ease;
}

.search-icon:hover {
  color: white;
}

.description {
  color: white;
  font-size: 0.85rem;
  line-height: 1.8;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  text-align: justify;
  margin: 0;
}

/* @media (max-width: 768px) {
  .content-container {
    width: 70%;
    left: 15%;
    gap: 15px;
    padding: 15px;
  }

  .search-icon {
    right: 10px;
    width: 20px;
    height: 20px;
  }

  .search-input {
    padding-right: 40px;
  }

  .title {
    font-size: 1.5rem;
  }

  .search-input {
    padding: 10px 20px;
  }

  .description {
    font-size: 0.75rem;
  }
} */
</style>